﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;

namespace NoIdeaSelfHost.Apis;

public class HomeController : ControllerBase
{
    readonly ILogger logger;
    public HomeController(ILogger logger)
    {
        this.logger = logger;
    }
    [HttpGet]
    public IActionResult TestLog()
    {
        logger.LogWarning($"测试警告日志......{DateTime.Now}");
        return Ok(new NoIdeaIoc.JsonResponse { Data = "响应数据", Msg = "测试成功" });
    }
    [HttpGet]
    public IActionResult Test()
    {
        return Ok(new NoIdeaIoc.JsonResponse { Data = "响应数据Json", Msg = "测试成功" });
    }
    [HttpGet]
    public IActionResult Index()
    {
        return base.Content("测试响应结果Html", "text/html;charset=utf-8");
    }
}
